package co.fitstart.entity.user.enums;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author haiyan_xiao
 *
 */
@Alias("studentTargetType")
public enum StudentTargetType {

    BODY_FAT_RATE_REDUCING("body_fat_rate_reducing", "减脂"),

    WEIGHT_LOSING("weight_losing", "减重"),

    MUSCLE_BUILDING("muscle_building", "增肌"),

    HEALTH("health", "健康"),
    
    POSTURE("posture", "体态"),
    
    OTHER("other", "其他");

    private String alias;

    private String description;

    private StudentTargetType(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }

    /**
     * 
     * @param ordinal
     * @return
     */
    public static StudentTargetType ordinralOf(int ordinal) {
        for(StudentTargetType targetType : StudentTargetType.values()) {
            if(targetType.ordinal() == ordinal) {
                return targetType;
            }
        }
        
        return null;
    }

    public boolean isWeightLosing() {
        return this.equals(WEIGHT_LOSING);
    }

    public boolean isBodyFatRateReducing() {
        return this.equals(BODY_FAT_RATE_REDUCING);
    }

    public boolean isMuscleBuilding() {
        return this.equals(MUSCLE_BUILDING);
    }

    public boolean isHealth() {
        return this.equals(HEALTH);
    }

    public boolean isPosture() {
        return this.equals(POSTURE);
    }

    public boolean isOther() {
        return this.equals(OTHER);
    }

    public boolean isDigital() {
        return this.equals(WEIGHT_LOSING) || this.equals(BODY_FAT_RATE_REDUCING) || this.equals(MUSCLE_BUILDING);
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
}
